package experiment7;

public class No_2 {
    public static void main(String []args){
        frog myfrog=new frog();
        rabbit myrabbit=new rabbit();
        myfrog.swim();
        myfrog.barking();
        myfrog.eat();

        myrabbit.barking();
        myrabbit.eat();
    }
}
abstract class Animal{
    String name;
    String color;
    String type;
    abstract public void eat();
    abstract public void barking();
}
interface Swim{
    abstract public void swim();
}
class rabbit extends Animal{
    @Override
    public void eat() {
        System.out.println("兔子正在吃草");
    }

    @Override
    public void barking() {
        System.out.println("兔子咋叫，我不知道啊");
    }
}
class frog extends Animal implements Swim{
    @Override
    public void barking() {
        System.out.println("呱呱呱");
    }

    @Override
    public void eat() {
        System.out.println("青蛙正在吃蚊子");
    }

    @Override
    public void swim() {
        System.out.println("青蛙正在游泳");
    }
}